<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view('common/head');?>
<body class="no-skin">
<?php $this->load->view('common/header');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>

                <!-- /section:settings.box -->
                <div class="row">
                    <form class="form-inline" action="" method="get">
                        <label class="inline">用户搜索</label>
                        <select name="field" class="form-control">
                            <option value="user">用户名</option>
                            <option value="phone">电话</option>
                            <option value="qq">QQ</option>
                            <option value="email">邮箱</option>
                        </select>
                        <input type="text" name="keyword" value="" class="form-control">
                        <label class="inline">&nbsp;&nbsp;排序：</label>
                        <select name="order" class="form-control">
                            <option  value="asc">注册时间升</option>
                            <option  value="desc">注册时间降</option>
                        </select>
                        <button type="submit" class="btn btn-purple btn-sm">
                            <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                            查询
                        </button>
                        <span class="btn btn-purple btn-sm" id="adduser">
                            <span class="ace-icon fa fa-user icon-on-right bigger-110"></span>
                            新增用户
                        </span>
                    </form>

                    <div class="col-xs-12">

                        </div>
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th class="center"><input class="check-all" type="checkbox" value=""></th>
                                <th>用户名</th>
                                <th>用户组</th>
                                <th class="center">性别</th>
                                <th class="center">生日</th>
                                <th>电话</th>
                                <th>Q&nbsp;Q</th>
                                <th>邮箱</th>
                                <th class="center">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php foreach ($users as $key => $val) { ?>
                                <tr>
                                    <td class="center">
                                        <?php if($val['user_id'] != 1){ ?>
                                            <input class="uids" type="checkbox" name="uids[]" value="{$val['uid']}">
                                        <?php }else{ ?>
                                            <span title="系统管理员，禁止删除">--</span>
                                        <?php } ?>
                                    </td>
                                    <td><?php echo $val['user_name']; ?></td>
                                    <td class="grouptd">
                                        <span class="group" val="<?php echo $val['user_id']; ?>"><?php echo $val['title']; ?></span>
                                    </td>
                                    <td class="center"><?php if($val['user_sex']==1){echo '男';}elseif($val['user_sex']==2){echo '女';}else{echo '保密';} ?></td>
                                    <td class="center"><?php echo $val['user_logtime']; ?></td>
                                    <td><?php echo $val['user_tel']; ?></td>
                                    <td><?php echo $val['user_qq']; ?></td>
                                    <td><?php echo $val['user_email']; ?></td>
                                    <td class="center">
                                        <a href="<?php echo site_url(X_URL.'member/edit/'.$val['user_id']);?>">修改</a>&nbsp;
                                        <?php if($val['user_id'] != 1){ ?>
                                            <a class="del" href="javascript:;" val="<?php echo site_url(X_URL.'member/del');?>" title="删除">删除</a>
                                        <?php } ?>
                                    </td>
                                </tr>
                            <?php }?>
                            </tbody>
                        </table>
<!--                        {$page}-->
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
    </div><!-- /.main-content -->

<?php $this->load->view('common/footer');?>
</div><!-- /.main-container -->

<?php $this->load->view('common/footerjs');?>
<!-- inline scripts related to this page -->
<script type="text/javascript">

    $(function () {
        $("#officialnews ul").html('<div class="ace-icon fa fa-spinner fa-spin orange"></div>');
    })
    $("#adduser").click(function () {
        window.location.href="add";
    });

</script>
</body>
</html>
